package com.vvitt.kotlinhiltcarhome.db

import androidx.paging.PagingSource
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.vvitt.kotlinhiltcarhome.entity.CarBrandEntity



/**
 * @ClassName CarBrandDao
 * @author please call me police uncel
 * @since 2023/5/25.
 * @email 110
 * @Version: V1.0.0
 * @desciption 汽车品牌，本地数据库操作的Dao层 数据库操作方法定义
 **/
@Dao
interface CarBrandDao {

    @Query("DELETE FROM CarBrandEntity")
    suspend fun clearCarBrand() : Void

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertCarBrand(carBrand : List<CarBrandEntity>)

    @Query("SELECT * FROM CarBrandEntity")
    fun getCarBrandList(): PagingSource<Int, CarBrandEntity>




}